package android.medicalcloud.com.yiapp.yilian.ui;

import android.medicalcloud.com.yiapp.R;
import android.medicalcloud.com.yiapp.base.activity.BaseActivity;
import android.medicalcloud.com.yiapp.yilian.logic.UserController;
import android.medicalcloud.com.yiapp.yilian.utils.android.IntentTool;
import android.os.Handler;
import android.os.Message;

import java.util.Timer;
import java.util.TimerTask;

/**
 * Created by wanggenlin on 17-5-18.
 */
public class LoadActivity extends BaseActivity{
    @Override
    protected void initView() {

    }

    @Override
    protected void initEvent() {

    }

    @Override
    protected void initData() {

        handler.sendEmptyMessageDelayed(0,2*1000);
    }

    Handler handler = new Handler(){
        @Override
        public void dispatchMessage(Message msg) {
            super.dispatchMessage(msg);
            if (UserController.getInstance().isLogin()){
                IntentTool.startMain(LoadActivity.this);
                finish();
                return;
            }
            IntentTool.login(LoadActivity.this);
            UserController.getInstance().saveToke("testToken");
            finish();
        }
    };
    @Override
    protected int getLayoutId() {
        return R.layout.ac_load;
    }
}
